import request from '@/utils/request'

export const authApi = {
  // 登录
  login(data) {
    return request.post('/auth/login', data)
  },
  
  // 注册
  register(data) {
    return request.post('/auth/register', data)
  },
  
  // 退出登录
  logout() {
    return request.post('/auth/logout')
  },
  
  // 获取当前用户信息
  getCurrentUser() {
    return request.get('/auth/current')
  },
  
  // 修改密码
  changePassword(oldPassword, newPassword) {
    return request.post('/auth/change-password', null, {
      params: { oldPassword, newPassword }
    })
  }
}

